package com.bohua.intermediary.controller;

import com.bohua.intermediary.common.Lay;
import com.bohua.intermediary.common.Msg;
import com.bohua.intermediary.entity.SysOwner;
import com.bohua.intermediary.service.SysOwnerService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
/**
 * 控制器
 * @author qian
 * @email 1415261159@qq.com
 * @date 2019/01/19
 */
@Controller
@RequestMapping("/sysOwner")
public class SysOwnerController {
    @Resource
    private SysOwnerService sysOwnerService;

    @RequestMapping
    public String sysOwner(){
        return "sysOwner/sysOwner";
    }
    @RequestMapping("/add")
    public String add(){
        return "sysOwner/addSysOwner";
    }

    @RequestMapping("/update")
    public String update(){
        return "sysOwner/updateSysOwner";
    }

    @RequestMapping("/getSysOwners")
    @ResponseBody
    public Lay getSysOwners(SysOwner sysOwner,Integer page,Integer limit){
        return sysOwnerService.getSysOwners(sysOwner,page,limit);
    }
    @RequestMapping("/addSysOwner")
    @ResponseBody
    public Msg addSysOwner(SysOwner sysOwner){
        return sysOwnerService.addSysOwner(sysOwner);
    }

    @RequestMapping("/updateSysOwner")
    @ResponseBody
    public Msg updateSysOwner(SysOwner sysOwner){
        return sysOwnerService.updateSysOwner(sysOwner);
    }

    @RequestMapping("/delSysOwner")
    @ResponseBody
    public Msg delSysOwner(SysOwner sysOwner){
        return sysOwnerService.delSysOwner(sysOwner);
    }
}
